package com.rxt.thermopro.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.app.common.viewmodel.BaseViewModel
import com.rxt.thermopro.app.LocalDataDao
import com.rxt.thermopro.bean.RingBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class BBQSettingViewModel : BaseViewModel() {

    val probeAlarmList: MutableLiveData<List<RingBean>> = MutableLiveData()

    fun getProbeAlarmList() {
        viewModelScope.launch {
            withContext(Dispatchers.IO) {
                val list = LocalDataDao.INSTANCE.getProbeAlarmList()
                withContext(Dispatchers.Main) {
                    probeAlarmList.value = list
                }
            }
        }
    }


}